﻿@using PagedList
@using PagedList.Mvc

@model IPagedList<DBTramite.BussinesEntities.T_Documento>

@{
    ViewBag.Title = "Index";
}

<div class="panel panel-primary">
    <div class="panel-heading">Tramite y Actualizaciones</div>
    <div class="panel-body">
        @using (Html.BeginForm())
        {
            <div class="row">
                <div class="col-md-3">
                    <select id="opcion" name="opcion" class="form-control">
                        <option value="1">Expediente</option>
                        <option value="2">Doc. Generado</option>  
                        <option value="3">Procedencia</option>
                        <option value="4">Asunto</option>
                        <option value="5">Expediente Inicial</option>              
                    </select>
                </div>
                <div class="col-md-4">
                    <input type="text" id="criterio" name="criterio" class="form-control" placeholder="Ingrese Criterio..."/>
                </div>
                <div class="col-md-1">
                    <button type="submit" class="btn btn-success">Buscar</button>
                </div>
            </div>
        }
        
    </div>
    <table class="table table-hover table-striped table-condensed">
        <thead>
            <tr>
                <th>
                    Nro. Expediente
                </th>
                <th>
                    Exp. Generador
                </th>
                <th>
                    Exp. Inicial
                </th>
                <th>
                    Tipo Documento
                </th>
                <th>
                    Nro. Documento
                </th>
                <th>
                    Emisor
                </th>
                <th>
                    Asunto
                </th>
                <th>Acciones</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model) {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.nroexpediente)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.expgenerador)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.codexpinicial)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.T_Tipodocumento.descripcion)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.nrodocumento)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.T_Emisor.nombre)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.asunto)
                    </td>
                    <td>
                        @Html.ActionLink("Tramitar", "Tramitar", new {  id=item.nroexpediente  },new{@class="btn btn-warning"})
                    </td>
        
                </tr>
            }
        </tbody>
        <tfoot>
            <tr>
                <td colspan="8">
                     @Html.PagedListPager( (IPagedList)Model, page => Url.Action("Index", new { page }) )
                </td>
            </tr>
        </tfoot>
    </table>
</div>

